import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import AdminBrand from '../views/admin/admin-brand.vue'
import AdminCategory from '../views/admin/admin-category.vue'
import AdminGoods from '../views/admin/admin-goods.vue'
import AdminSpecification from '../views/admin/admin-specification.vue'
import AdminTemplates from '../views/admin/admin-templates.vue'
import AdminContent from '../views/content/admin-content.vue'
import ContentCategory from '../views/content/admin-contentCategory.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children: [
      {
        path: '/admin/brand',
        name: 'AdminBrand',
        component: AdminBrand
      },
      {
        path: '/admin/category',
        name: 'AdminCategory',
        component: AdminCategory
      },
      {
        path: '/admin/goods',
        name: 'AdminGoods',
        component: AdminGoods
      },
      {
        path: '/admin/specification',
        name: 'AdminSpecification',
        component: AdminSpecification
      },
      {
        path: '/admin/templates',
        name: 'AdminTemplates',
        component: AdminTemplates
      },
      {
        path: '/admin/content',
        name: 'AdminContent',
        component: AdminContent
      },
      {
        path: '/admin/contentCategory',
        name: 'ContentCategory',
        component: ContentCategory
      },
    ]
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
